<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>数据作业配置修改</title>
<link href="../../static/plugin/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/plugin/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<link href="../../static/css/esaas-easyui-edit.css" rel="stylesheet" type="text/css"/>
<script src="../../static/plugin/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/plugin/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/plugin/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout" scroll="no">
	<form id="ff" method="post">
		<div class="esaas-info-title">数据作业配置信息</div>
		<table class="esaas-info-edit-table">
			<tr>
				<td width="15%" align="right">配置标识符：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="pluginConfId"
					name="pluginConfId" data-options="required:true, disabled: true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">配置顺序：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="confSort" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">作业名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="jobName" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
					
				<td width="15%" align="right">作业实现：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="jobImplement" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">参数组标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="paramGroupId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">SQL脚本用途：</td>
				<td width="35%"><select class="easyui-combobox"
					id="sqlPurpose" name="sqlPurpose"
					style="width: 100%; height: 25px;"
					data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:BAT_SQL_PURPOSE">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right">SQL脚本：</td>
				<td width="85%" colspan="3"><input class="easyui-textbox" type="text"
					name="sqlContent" data-options="required:false, multiline: true"
					style="width: 100%; height: 100px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">作业失败处理方式：</td>
				<td width="35%"><select class="easyui-combobox"
					id="jobFaildDeal" name="jobFaildDeal"
					style="width: 100%; height: 25px;"
					data-options="required:false,editable:false,valueField:'enname',textField:'cnname',data:BAT_FAILD_DEAL_TYPE">
				</select></td>
				<td width="15%" align="right">最后更新日期：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="lastModifyDate" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div style="text-align: center; padding: 15px">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>		
		$(function() {
			var pluginConfId = $.getUrlParam('pluginConfId');
			var confSort = $.getUrlParam('confSort');
			$.restfulGet('../../api/plugin/job/conf/' + pluginConfId + '/' + confSort,null,function(data){
					$('#ff').form('load', {
						pluginConfId : data.rows.pluginConfId,
						confSort : data.rows.confSort,
						jobName : data.rows.jobName,
						sqlPurpose : data.rows.sqlPurpose,
						sqlContent : data.rows.sqlContent,
						paramGroupId : data.rows.paramGroupId,
						jobFaildDeal : data.rows.jobFaildDeal,
						lastModifyDate : data.rows.lastModifyDate,
						jobImplement : data.rows.jobImplement
					});					
			});
		});
	
		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPut('../../api/plugin/job/conf', jsonData, function(data) {
				window.parent.reloadList();
			});
		};
		
		function closeForm(){
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
